<?php

namespace SpecialOperations\GameBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * SpecialOperations\GameBundle\Entity\CoalMine
 */
class CoalMine extends Building
{
    

    public function getCoalProduction($from, $to=null){
        if(!$to){
            $to=time();
        }
        $time=$to-$from;
        return $this->getCoalProductionRatio()*$time/District::TIME;
        
    }
    
    public function getCoalProductionRatio(){
        return (20*($this->getLevel()+1)*$this->getWorstMultiplier()*pow(1.1, $this->getLevel()*$this->getWorstMultiplier()));
    }
    
    public function __ToString(){
        return 'Kopalnie węgla';
    }
}